#include "gui_menu_info.h"
#include "sys_stdio.h"

static GUI_OBJECT(information);
    static GUI_OBJECT(online_parameter);
        static GUI_OBJECT(sim_card);

        static GUI_OBJECT(vin);

        static GUI_OBJECT(plate_color);

        static GUI_OBJECT(plate_number);

        static GUI_OBJECT(terminal_id);

        static GUI_OBJECT(province_id);

        static GUI_OBJECT(city_id);

    static GUI_OBJECT(device_information);
        static GUI_OBJECT(software_version);

        static GUI_OBJECT(hardware_version);

        static GUI_OBJECT(firmware_version);

        static GUI_OBJECT(active_safety_version);

        static GUI_OBJECT(boot_version);

    static GUI_OBJECT(paltform_address);

static int sim_card_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"sim卡号:4512",0);
    sj_kprintf("获取sim卡信息 \r\n");

    out:
    return ret;
}

static int vin_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"vin编号:456",0);
    sj_kprintf("vin编号 \r\n");

    out:
    return ret;
}

static int plate_color_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"车牌颜色:蓝色",0);
    sj_kprintf("车牌颜色 \r\n");

    out:
    return ret;
}

static int plate_number_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"车牌号码:鲁AS8569A",0);
    sj_kprintf("车牌号码 \r\n");

    out:
    return ret;
}

static int terminal_id_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"终端id:6",0);
    sj_kprintf("终端id \r\n");

    out:
    return ret;
}

static int province_id_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"省区id:3",0);
    sj_kprintf("省区id \r\n");

    out:
    return ret;
}

static int city_id_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"市县id:7",0);
    sj_kprintf("市县id \r\n");

    out:
    return ret;
}

static int software_version_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"软件版本:1.0",0);
    sj_kprintf("软件版本 \r\n");

    out:
    return ret;
}

static int hardware_version_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"硬件版本:2.0",0);
    sj_kprintf("硬件版本 \r\n");

    out:
    return ret;
}

static int firmware_version_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"固件版本:3.0",0);
    sj_kprintf("固件版本 \r\n");

    out:
    return ret;
}

static int active_safety_version_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"主动安全版本:4.0",0);
    sj_kprintf("主动安全版本 \r\n");

    out:
    return ret;
}

static int boot_version_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"boot版本:50",0);
    sj_kprintf("boot版本 \r\n");

    out:
    return ret;
}

static int paltform_address_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"平台地址:ky",0);
    sj_kprintf("平台地址查询 \r\n");

    out:
    return ret;
}

void gui_menu_add_information(struct gui_object *menu)
{
    gui_object_init(&information,"信息查询");
        gui_object_init(&online_parameter,"上线参数查询");
            gui_object_init(&sim_card,"SIM卡");

            gui_object_init(&vin,"VIN");

            gui_object_init(&plate_color,"车牌颜色");

            gui_object_init(&plate_number,"车牌号码");

            gui_object_init(&terminal_id,"终端ID");

            gui_object_init(&province_id,"省域ID");

            gui_object_init(&city_id,"市县ID");

        gui_object_init(&device_information,"设备信息查询");
            gui_object_init(&software_version,"软件版本");

            gui_object_init(&hardware_version,"硬件版本");

            gui_object_init(&firmware_version,"固件版本");

            gui_object_init(&active_safety_version,"主动安全版本");

            gui_object_init(&boot_version,"BOOT版本");

        gui_object_init(&paltform_address,"平台地址查询");

    gui_object_add_child(menu,&information);

        gui_object_add_child(&information,&paltform_address);
        gui_object_add_content(&paltform_address,paltform_address_content);

        gui_object_add_child(&information,&device_information);
            gui_object_add_child(&device_information,&boot_version);
            gui_object_add_content(&boot_version,boot_version_content);
            gui_object_add_child(&device_information,&active_safety_version);
            gui_object_add_content(&active_safety_version,active_safety_version_content);
            gui_object_add_child(&device_information,&firmware_version);
            gui_object_add_content(&firmware_version,firmware_version_content);
            gui_object_add_child(&device_information,&hardware_version);
            gui_object_add_content(&hardware_version,hardware_version_content);
            gui_object_add_child(&device_information,&software_version);
            gui_object_add_content(&software_version,software_version_content);

        gui_object_add_child(&information,&online_parameter);
            gui_object_add_child(&online_parameter,&city_id);
            gui_object_add_content(&city_id,city_id_content);
            gui_object_add_child(&online_parameter,&province_id);
            gui_object_add_content(&province_id,province_id_content);
            gui_object_add_child(&online_parameter,&terminal_id);
            gui_object_add_content(&terminal_id,terminal_id_content);
            gui_object_add_child(&online_parameter,&plate_number);
            gui_object_add_content(&plate_number,plate_number_content);
            gui_object_add_child(&online_parameter,&plate_color);
            gui_object_add_content(&plate_color,plate_color_content);
            gui_object_add_child(&online_parameter,&vin);
            gui_object_add_content(&vin,vin_content);
            gui_object_add_child(&online_parameter,&sim_card);
            gui_object_add_content(&sim_card,sim_card_content);

}
